<%@include file="../../context.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Intraday Share Data List</title>
<%@include file="../../common_imports.jsp"%>
<script type="text/javascript"
	src="<c:url value="/resources/js/jquery-ui-1.10.4.js" />"></script>

<link href="<c:url value="/resources/css/jquery-ui-1.10.4.css" />"
	rel="stylesheet" type="text/css"></link>

<script type="text/javascript">
	$(document).ready(function() {
		$(".datepicker").datepicker({
			dateFormat : "dd/mm/yy"
		});
	});
</script>
</head>
<body>
	<div class="main_wrapper">
		<div class="header_wrapper">
			<div class="container-fluid">
				<div class="header_inner_wrapper clearfix">
					<div class="row-fluid">
						<div class="header_left span4">Intraday Share Data List</div>
						<div class="header_right span8">
							<div class="input-append">
								<!-- search section -->
								<form:form method="POST" commandName="criteria"
									action="${pageContext.request.contextPath}/dailysharedata/search.html">
									<form:input cssClass="datepicker" path="fromDate"
										id="fromDatepicker" />
									<form:input cssClass="datepicker" path="toDate"
										id="toDatepicker" />
									<form:select cssClass="searchSelector" path="companyId">
										<form:option value="-1">--ANY--</form:option>
										<form:options itemValue="id" itemLabel="name"
											items="${companyMap}" />
									</form:select>
									<input class="btnSerch btn-info" type="submit" value="Search"></input>
								</form:form>
								<!-- end of search section -->
							</div>
						</div>
					</div>
				</div>

				<div class="row-fluid">
					<div class="main_table">
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th id="tableHeader">No</th>
									<th id="tableHeader">Ticker</th>
									<th id="tableHeader">Date</th>
									<th id="tableHeader">Share Price</th>
									<th id="tableHeader">Trade Volume</th>
									<th id="tableHeader">Change</th>
									<th id="tableHeader">Percentage Change</th>
									<th id="tableHeader">High</th>
									<th id="tableHeader">Low</th>
									<th></th>
									<th></th>
								</tr>
							</thead>
							<tbody>

								<c:forEach var="intradayShareData"
									items="${intradayShareDataPage.pageData}">
									<tr>
										<td>${intradayShareData.id}</td>
										<td>${intradayShareData.company.name}</td>
										<td id="dateAlign">${intradayShareData.time}</td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${intradayShareData.lastTradedPrice}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${intradayShareData.tradeVolume}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${intradayShareData.valueChange}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${intradayShareData.percentageChange}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${intradayShareData.high}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${intradayShareData.low}" /></td>
										<td>
											<div class="btn btn-info">
												<a
													href="${pageContext.request.contextPath}/intradaysharedata/edit/${intradayShareData.id}.html">Edit</a>
											</div>
										</td>
										<td><div class="btn btn-danger">
												<a
													href="${pageContext.request.contextPath}/intradaysharedata/delete/${intradayShareData.id}.html">Delete</a>
											</div></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<!-- paging section -->
						<div class="pagination pagination-right">
							<ul>
								<li><c:if test="${intradayShareDataPage.showPrev}">
										<a
											href="${pageContext.request.contextPath}/intradaysharedata/list.html?page=${intradayShareDataPage.currentPageNo-1}&totalRecords=${intradayShareDataPage.totalNoOfRecords}">Prev</a>
									</c:if></li>
								<c:forEach begin="${intradayShareDataPage.startPageNo}"
									var="page" end="${intradayShareDataPage.endPageNo}">
									<li><a
										<c:if test="${intradayShareDataPage.currentPageNo==page}">style="background-color:#79BAEC"</c:if>
										href="${pageContext.request.contextPath}/intradaysharedata/list.html?page=${page}&totalRecords=${intradayShareDataPage.totalNoOfRecords}">${page}</a></li>&nbsp;
							</c:forEach>
								<li><c:if test="${intradayShareDataPage.showNext}">
										<a
											href="${pageContext.request.contextPath}/intradaysharedata/list.html?page=${intradayShareDataPage.currentPageNo+1}&totalRecords=${intradayShareDataPage.totalNoOfRecords}">Next</a>
									</c:if></li>
								<li><a class="pageCountLink">${intradayShareDataPage.totalNoOfPages }
										Pages</a></li>
							</ul>
						</div>
						<div>
							<br></br>
						</div>
						<!-- paging section -->

						<div class="btn btn-success">
							<a
								href="${pageContext.request.contextPath}/intradaysharedata/add.html">New</a>

						</div>
						<div class="btn btn-info">
							<a href="${pageContext.request.contextPath}/index.html">Home
								page</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>